<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>道路车辆智能监测系统</title>
	<link href="css/start/jquery-ui-1.10.3.custom.css" rel="stylesheet" id="mycss">
	<link href="css/rvims.css" rel="stylesheet" >
	<style type="text/css">
		.fontRed{
			color:red;
		}
	</style>
	<script src="js/jquery-1.9.1.js"></script>
	<script src="js/jquery-ui-1.10.3.custom.js"></script>
	
	<script src="js/common.js"></script>
	<script src="js/control.js"></script>
	<script src="js/dialog.js"></script>
	<script>
		$(function() {
			$( "button" ).button();
			setTableCSS("ControlTasksTable");
			$("#textSXSJ").datepicker(
				{dateFormat:"yy-mm-dd"}
			);
		  	$("#textJZSJ").datepicker(
		  		{dateFormat:"yy-mm-dd"}
		  	);
		});
		
	</script>
</head>
<body>
	<div id="maindiv">
		<%@ include file="../common/header.jsp"%>
		<div id="content">
			<h3>布控车辆 >> 维护布控车辆</h3>
			<!--  <span class="fontRed">注:</span>带"<span class="fontRed">*</span>"为必填项-->
			<form id="frmCVEdit" action="saveControlVehicle.do" method="post">
				<input type="hidden" name="id" value="${controlVehicle.id }">
				<table>
					<tr>
						<td align="right" style="width:90px;">号牌号码：</span></td>
						<td><input type="text" id="txtHPHM" name="licencePlate" value="${controlVehicle.licencePlate }"></td>
						<td style="width:90px" align="right">车辆类型：</td>
						<td >
							<select id="sltCLLX" name="vehicleType.id">
							<c:forEach items="${listVehicleType}" var="vehicleType">
								<option value="${vehicleType.id }" ${controlVehicle.vehicleType.id == vehicleType.id ? 'selected' : ''}>${vehicleType.name }</option>
							</c:forEach>
							</select>							
						</td>
					</tr>
					<tr>
						<td align="right" valign="top" style="width:90px;">号牌类型：</td>
						<td>
							<select id="sltHPLX" name="licencePlateType.id">
							<c:forEach items="${listLicencePlateType}" var="licencePlateType">
								<option value="${licencePlateType.id }" ${controlVehicle.licencePlateType.id == licencePlateType.id ? 'selected' : ''}>${licencePlateType.name }</option>
							</c:forEach>
							</select>
						</td>
						<td style="width:90px" align="right">号牌种类：</td>
						<td >
							<select id="sltHPZL" name="licencePlateKind.id" >
							<c:forEach items="${listLicencePlateKind}" var="licencePlateKind">
								<option value="${licencePlateKind.id }" ${controlVehicle.licencePlateKind.id == licencePlateKind.id ? 'selected' : ''}>${licencePlateKind.name }</option>
							</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right" style="width:90px;">车身颜色：</td>
						<td>
							<select id="sltCSYS" name="vehicleColour.id">								
							<c:forEach items="${listVehicleColour}" var="vehicleColour">
								<option value="${vehicleColour.id }" ${controlVehicle.vehicleColour.id == vehicleColour.id ? 'selected' : ''}>${vehicleColour.name }</option>
							</c:forEach>
							</select>
						</td>
						<td style="width:90px" align="right">号牌颜色：</td>
						<td>
							<select id="sltHPYS" name="licencePlateColour.id">
							<c:forEach items="${listLicencePlateColour}" var="licencePlateColour">
								<option value="${licencePlateColour.id }" ${controlVehicle.licencePlateColour.id == licencePlateColour.id ? 'selected' : ''}>${licencePlateColour.name }</option>
							</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right" valign="top" style="width:90px;">生效时间：</td>
						<td><input type="text" id="textSXSJ" readonly="readonly" value="<fmt:formatDate value="${controlVehicle.beginTime}"/>" name="strBeginTime" /></td>
						<td align="right" style="width:90px">截止时间：</td>
						<td><input type="text" id="textJZSJ" readonly="readonly" value="<fmt:formatDate value="${controlVehicle.endTime}"/>" name="strEndTime" /></td>
					</tr>
					<tr>
						<td align="right" style="width:90px;">布控类型：</td>
						<td >
							<select id="sltBKLX"  name="controlType.id">
								<c:forEach items="${listControlType}" var="controlType">
									<option value="${controlType.id }" ${controlVehicle.controlType.id == controlType.id ? 'selected' : ''}>${controlType.name }</option>
								</c:forEach>
							</select>
						</td>					
						<td align="right" valign="top"style="width:90px;">添加原因：</td>
						<td>
							<textarea style="width:180px;" id="txtTJYY" name="description">${controlVehicle.description }</textarea>
						</td>
					</tr>
				</table>				
				<div style="width:100%;">				
				<button style="float:left;margin-left:20px;" onclick="showControlTaskDialog('ControlTasksTable');return false;" >选择布控任务</button>
				<br><br><br><br>
				<div style="width:80%;height:160px;margin-left:20px;">
					<table id="ControlTasksTable" style="min-width:400px;" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>任务名称</td>
								<td>生效时间</td>
								<td>截止时间</td>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${listControlTask}" var="controlTask">
								<tr  id="objId_${controlTask.id }" > 
									<td><input type="hidden" value="${controlTask.id }">${controlTask.name }</td>
									<td><fmt:formatDate value="${controlTask.beginTime }"/></td>
									<td><fmt:formatDate value="${controlTask.endTime }"/></td>
								</tr>
						</c:forEach>
						</tbody>
					</table>
			</div>
			<div style="width:100%;height:40px;margin-top:20px;">
				<button style="float:left;" onclick="saveControlVehicle()">保存</button>
				<button style="float:left;margin-left:10px;" onclick="showControlVehicleSearch()">关闭</button>
			</div>		
			</div>			
			</div>			
			</form>		
			<%@ include file="../common/footer.jsp"%>		
		</div>
		
	
</body>
</html>